//
//  CBCViewController.m
//  CBCChannelControl
//
//  Created by 李雷川 on 07/01/2019.
//  Copyright (c) 2019 李雷川. All rights reserved.
//

#import "CBCViewController.h"
#import <CBCChannelControl/CBCChannelControl.h>

@implementation CBCViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)tapChannel:(id)sender{
    for (NSUInteger i = 0;i<20;i++){
        CBCChannelModel *model = [[CBCChannelModel alloc]init];
        model.title = [NSString stringWithFormat:@"电影%lu",(unsigned long)i];
        [[CBCChannelManager shared].inUseItems addObject:model];
    }
    
    CBCChannelViewController *channelVC = [[CBCChannelViewController alloc]init];
    channelVC.selectIndex = 0;
    [self addChildViewController:channelVC];
    [self.view addSubview:channelVC.view];
    channelVC.itemSelect = ^(NSInteger index){
        NSLog(@"index is%ld",index);
    };
    //    [self presentViewController:channelVC animated:true completion:nil];
}
@end
